﻿using Iworld.Administrator.Service.Export;
using Iworld.Administrator.Service.Import;
using Iworld.basis.Service;
using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel;
using System.Text;
using System.Threading.Tasks;

namespace Iworld.Administrator.Service
{
    /// <summary>
    /// 定义管理员相关的数据服务
    /// </summary>
    [ServiceContract]
    public interface IAdministratorService
    {
        #region 查询数据
        /// <summary>
        /// 获取管理员信息的分页列表
        /// </summary>
        /// <param name="import">数据集</param>
        /// <returns>返回管理员信息的分页列表</returns>
        [OperationContract]
        PageResult<AdministratorExport> GetAdministrators(GetAdministratorsImport import);

        /// <summary>
        /// 获取管理员组的分页列表
        /// </summary>
        /// <param name="import">数据集</param>
        /// <returns>返回管理员组的分页列表</returns>
        [OperationContract]
        PageResult<AdministratorGroupExport> GetAdministratorGroups(GetAdministratorGroupsImport import);
         
        /// <summary>
        /// 获取管理员登陆记录的分页列表
        /// </summary>
        /// <param name="import">数据集</param>
        /// <returns>返回管理员登陆记录的分页列表</returns>
        [OperationContract]
        PageResult<AdministratorLandingRecordExport> GetAdministratorLandingRecords(GetAdministratorLandingRecordsImport import);

        #endregion

        #region 操作
        /// <summary>
        /// 登陆
        /// </summary>
        /// <param name="import">数据集</param>
        /// <returns>返回操作结果</returns>
        [OperationContract]
        NormalResult<AdministratorExport> Login(LoginImport import);

        /// <summary>
        /// 创建新的管理员
        /// </summary>
        /// <param name="import">数据集</param>
        /// <returns>返回操作结果</returns>
        [OperationContract]
        NormalResult CreateAdministrator(CreateAdministratorImport import);


        /// <summary>
        /// 编辑管理员
        /// </summary>
        /// <param name="import">数据集</param>
        /// <returns>返回操作结果</returns>
        [OperationContract]
        NormalResult EditAdministrator(EditAdministratorImport import);


        /// <summary>
        /// 修改密码
        /// </summary>
        /// <param name="import">数据集</param>
        /// <returns>返回操作结果</returns>
        [OperationContract]
        NormalResult EditPassword(EditPasswordImport import);

        /// <summary>
        /// 移除管理员
        /// </summary>
        /// <param name="import">数据集</param>
        /// <returns>返回操作结果</returns>
        [OperationContract]
        NormalResult RemoveAdministrator(RemoveAdministratorImport import);

        /// <summary>
        /// 创建新的管理员组
        /// </summary>
        /// <param name="import">数据集</param>
        /// <returns>返回操作结果</returns>
        [OperationContract]
        NormalResult CreateAdministratorGroup(CreateAdministratorGroupImport import);

        /// <summary>
        /// 修改管理员组
        /// </summary>
        /// <param name="import">数据集</param>
        /// <returns>返回操作结果</returns>
        [OperationContract]
        NormalResult EditAdministratorGroup(EditAdministratorGroupImport import);

        /// <summary>
        /// 移除管理员组
        /// </summary>
        /// <param name="import">数据集</param>
        /// <returns>返回操作结果</returns>
        [OperationContract]
        NormalResult RemoveAdministratorGroup(RemoveAdministratorGroupImport import);

        /// <summary>
        /// 保持心跳
        /// </summary>
        /// <param name="import">数据集</param>
        /// <returns></returns>
        [OperationContract]
        NormalResult<KeepHeartbeatExport> KeepHeartbeat(KeepHeartbeatImport import);
        #endregion
    }
}
